[Home] Python으로 돌아가기

Python 실행 및 실행 파일(exe) 만들기

목차

1. 실행 방법
2. 실행 파일(exe) 만들기

1. Anaconda 실행 방법

Python 프로그램을 실행하는 방법에는 여러 가지가 있다. 아래는 Anaconda에서 실행하는 방법이다.

(1) Prompt 실행 방법

(2) IPython에서 실행

(3) Spyder에서 실행

2. 실행 파일(exe) 만들기 - PyInstaller

Python 프로그램을 실행 파일로 변환하려면 PyInstaller를 사용할 수 있다.

(1) PyInstaller 설치

다음 명령어를 입력하여 PyInstaller를 설치한다.

conda install pyinstaller
PyInstaller 설치

(2) 실행 파일 생성

아래 명령어를 입력하면 실행 파일이 생성된다.

pyinstaller --onefile script.py

위 명령을 실행하면 dist 폴더에 실행 파일이 생성된다.

Python 실행 방법 PyInstaller 실행 파일 생성

(3) 실행 파일 다운로드

완성된 실행 파일을 다운로드할 수 있다.

실행 파일 다운로드 (ZIP)